Make gdk_x11_window_set_theme_variant do nothing for non-toplevels
authorMatthias Clasen <mclasen@redhat.com>
Sun, 3 Apr 2011 21:40:37 +0000 (17:40 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 3 Apr 2011 21:40:37 +0000 (17:40 -0400)
This avoids problems when calling this e.g. on offscreen windows.

gdk/x11/gdkwindow-x11.c

index fd62e4caadc47355c9d868a23141318ff7228f8f..78ec0a49926438e0b4d7db8d470eafffa09027f8 100644 (file)
@@ -3107,7 +3107,12 @@ void
 gdk_x11_window_set_theme_variant (GdkWindow *window,
                                   char      *variant)
 {
-  GdkDisplay *display = gdk_window_get_display (window);
+  GdkDisplay *display;
+
+  if (!WINDOW_IS_TOPLEVEL (window))
+    return;
+
+  display = gdk_window_get_display (window);
 
   if (variant != NULL)
     {